package com.msb.api.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

/**
 * @Author: lmf
 * @Create: 2025/3/8 13:28
 * Description:  访问缓存模块feign
 */
@FeignClient(value = "beacon-cache")
@RequestMapping("/cache")
public interface BeaconCacheClient {

    @GetMapping(value = "/hGetAll/{key}")
    Map<String, Object> hGetAll(@PathVariable(value = "key") String key);

    @GetMapping(value = "/hGet/{key}/{field}")
    Object hGet(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);

    @GetMapping(value = "/hGetToString/{key}/{field}")
    String hGetToString(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);

    @GetMapping(value = "/sMembers/{key}")
    Set<Map<String, Object>> sMembers(@PathVariable(value = "key") String key);

    @GetMapping(value = "/get/{key}")
    Object get(@PathVariable(value = "key") String key);
}
